/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 通用容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 主要内容区域 */
main {
    margin-top: 20px;
}

/* 章节标题样式 */
section {
    margin: 40px auto;
    max-width: 1200px;
    padding: 0 20px;
}

section h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    position: relative;
    padding-left: 15px;
}

/* section h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: #007bff;
    border-radius: 2px;
} */

/* 搜索结果标题样式 */
.search-title {
    /* background:  #2196F3; */
    color: black;
    /* padding: 25px 40px; */
    margin: 0;
    text-align:center;
    /* border-bottom: 3px solid rgba(255, 255, 255, 0.2); */
}

.search-title h2 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.search-title h2::before {
    display: none; /* 隐藏section h2的伪元素 */
}

.search-title h2 i {
    font-size: 1.5rem;
    opacity: 0.9;
}

.search-title .search-info {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* 课程卡片样式 */
.course-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 固定4列 */
    gap: 25px;
    padding: 10px;
}
/*对移动端小屏幕进行适应*/
@media (max-width: 1200px) {
    .course-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .course-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .course-list {
        grid-template-columns: repeat(1, 1fr);
    }
}

.course-card {
    background: #fff;
    border-radius: 12px;
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); */
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.course-card a{
    display: block;
}

.course-card:hover {
    transform: translateY(-5px);
    /* box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); */
}

.course-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:hover img {
    transform: scale(1.05);
}

.course-info {
    padding: 20px;
}

.course-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #0b0b0e;
    line-height: 1.4;
}
.course-card:hover h3 {
    color: #0c0c116c;
    /* transform: scale(1.05); */
}

/*显示主页分类*/
.course-image {
    position: relative; /* 为内部 badge 提供定位参照 */
}

.course-category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.6); /* 黑色透明背景 */
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none; /* 避免影响点击 */
}

/*不要课程描述*/
/* .course-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: -webkit-box;
    /* -webkit-line-clamp: 2; */
    /* -webkit-box-orient: vertical;
    overflow: hidden;
} */ 

.category{
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
}


/* 新课程标记 */
.new-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4757;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(255, 71, 87, 0.3);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 我的内容页面样式 */
.my-courses,
.my-notes,
.my-assignments,
.my-progress {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.notes-list,
.assignments-list,
.progress-list {
    display: grid;
    gap: 20px;
}

.note-item,
.assignment-item,
.progress-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.3s ease;
}

.note-item:hover,
.assignment-item:hover {
    transform: translateY(-3px);
}

.note-meta,
.assignment-meta {
    margin-top: 15px;
    font-size: 13px;
    color: #666;
}

.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.status.completed {
    background: #28a745;
    color: white;
}

.status.pending {
    background: #ffc107;
    color: #000;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #00d2ff);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .course-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }

    section {
        margin: 5px auto;
    }

    .course-card img {
        height: 160px;
    }

    /* 搜索结果标题移动端样式 */
    .search-title {
        padding: 20px 20px;
        margin: 15px 0;
    }

    .search-title h2 {
        font-size: 1.4rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .search-title .search-info {
        font-size: 0.9rem;
    }
}
/*查看更多按钮样例*/
.toggle-btn-wrapper {
    display: flex;
    justify-content: center; /* 水平居中 */
    margin-top: 12px;
}

#toggle-courses-btn {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#toggle-courses-btn:hover {
    background-color: #0056b3;
}

